package lbj.cyw.dp;

/*
* 大数取模问题
* */

public class Offer14cuttingRope2 {
    public int cuttingRope(int n){
        if(n==2){
            return 2;
        }
        if(n==3){
            return 3;
        }
        long res=0;
        while(n>=4){
            res=(res*3)%1000000007;
            n-=3;
        }
        return (int)res;
    }
}
